home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_5 / issue_06 / benchmarks / c_source / imath < prev    next >
Encoding:
Text File  |  1991-04-29  |  404 b   |  22 lines

  1. /* Intmath */
  2.  
  3. #include <time2.h>
  4. #include <stdio.h>
  5.  
  6. int main(void)
  7. {
  8.         int x,y,i;
  9.     clock_t start, end;
  10.  
  11.     start = clock(); /*gets system time*/
  12.     x =0;
  13.     y =9;
  14.         printf("start\n");
  15.         for (i=0; i<30000; i++)
  16.         x = x + (y*y-y)/y;
  17.  
  18.     end=clock();
  19.     printf(" finish %d \n",x);
  20.         printf("The timing for this integer math test was: %f\n", (end-start) / CLK_TCK);
  21. }
  22.